CREATE TABLE dm_dev_inout_center_network_summary_dt
(
    scan_site_code    varchar(65533) COMMENT "扫描中心code",
    scan_site_name    varchar(65533) COMMENT "扫描中心name",
    site_agent_code   varchar(65533) COMMENT "代理区code",
    site_agent_name   varchar(65533) COMMENT "代理区name",
    out_way_num       int(11) COMMENT "出港量 出港件量（票） <中心出港件量>",
    out_pack_way_num  int(11) COMMENT "出港到件包内票量（票） <中心出港包内件量>",
    out_build_way_num int(11) COMMENT "出港 本中心建包的票数",
    out_zddev_way_num int(11) COMMENT "出港 自动线建包量（票）",
    out_rgdev_way_num int(11) COMMENT "出港 人工建包量（票）",
    in_way_num        int(11) COMMENT "进港件量（票） <中心进港件量>",
    in_pack_way_num   int(11) COMMENT "进港到件包内票量（票） <中心进港包内件量>",
    in_build_way_num  int(11) COMMENT "进港 本中心建包的票数",
    in_tear_way_num   int(11) COMMENT "进港 拆包包内票总数（票）",
    in_tear_pack_num  int(11) COMMENT "进港 拆包数",
    out_dev_num       int(11) COMMENT "中心建包量（票）",
    total_out_way_num int(11) COMMENT "所有中心出港总件量",
    total_in_way_num  int(11) COMMENT "所有中心进港总件量",
    out_sum           int(11) COMMENT "（出港到件包内票量+中心建包量）",
    out_small_rate    decimal(16, 2) COMMENT "出港小件占比",
    out_way_rate      decimal(16, 2) COMMENT "操作量占比(出港)",
    in_way_rate       decimal(16, 2) COMMENT "操作量占比(进港)",
    in_small_rate     decimal(16, 2) COMMENT "进港到件小件占比",
    in_pack_rate      decimal(16, 2) COMMENT "进港建包率",
    date_time         date COMMENT "日期"
) ENGINE=OLAP 
DUPLICATE KEY(scan_site_code)
COMMENT "设备中转件量分析汇总" 
PARTITION BY RANGE(date_time)
(START ("2023-06-01") END ("2023-06-10") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(scan_site_code) BUCKETS 1 
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);